package login.dataObjects
{
	import mx.collections.ArrayCollection;

	public class EnvironmentDO
	{
		public var INTERNAL_ENV_NUM:String = "";
		public var ENVIRONMENT:String = "";
		public var CONN_STRING:String = "";
		public var COMPANY:String = "";
		
		public function EnvironmentDO()
		{
		}

		public function Init(xmlObj:XML):void{			
			if(null == xmlObj)
				return;
			else{
				for each (var itemProp:XML in xmlObj.children()) {
					this[itemProp.name()] = itemProp;
				}
			}
		}

		public static function getEnvironments(list:XMLList):ArrayCollection
		{
			var ac:ArrayCollection = new ArrayCollection();
			for each(var xml:XML in list)
			{
				var env:EnvironmentDO = new EnvironmentDO();
				env.Init(xml);
				ac.addItem(env);
			}
			return ac;
		}			
	}
}